import asyncio
import os
import sys


sys.path.append(os.path.join(os.path.dirname(__file__), "/root/work/arcfox-crawler"))
from com.arcfox.yiqing.spider.baidu_yiqing_spider import BaiduYiQingSpider


class BaiduYiQingService:

    def __init__(self):
        self.baidu_yiqing_spider = BaiduYiQingSpider()

    async def start(self):
        tasks = [
            asyncio.create_task(self.baidu_yiqing_spider.start_crawl()),
        ]
        await asyncio.gather(*tasks)


if __name__ == "__main__":
    asyncio.run(BaiduYiQingService().start())
